package com.wanwu.channel.remote.alipay.config;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.io.Serializable;

@Data
@Configuration
@ConfigurationProperties(prefix = "alipay.app")
public class AlipayConfiguration implements Serializable, InitializingBean {
    private static AlipayConfiguration instance = null;

    @Override
    public void afterPropertiesSet() throws Exception {
        instance = this;
    }

    public static AlipayConfiguration getInstance() {
        return instance;
    }

    /**
         * 支付宝openapi域名
         */
    private String openApiDomain;

    /**
     * 支付宝公钥
     */
    private String alipayPublicKey;

    /**
     * 私钥
     */
    private String qdPrivateKey;

    /**
     * 商户partner id
     */
    private String appid;

    /**
     * 支付宝支付回调地址
     */
    private String payNotifyUrl;
    /**
     * 支付宝退款回调地址
     */
    private String refundNotifyUrl;

    /**
     * 超时时间，毫秒
     */
    private Integer readTimeout;
    private Integer connectTimeout;

    // 字符编码格式 目前支持 gbk 或 utf-8
    private String inputCharset = "utf-8";

    // 签名方式 不需修改
    private String declareSignType = "RSA";

    // 支付宝的公钥，无需修改该值
    private String mapiAlipayPublicKey ;
    //partnerId
    private String mapiPid;
    //
    private String qdMapiPrivateKey;


}
